using System.Drawing;
using Tiwo.Design.ItemRenderers;

namespace Tiwo.Design.Renderers
{
    public abstract class RectangularRenderer : IRenderer
    {
        protected RectangularRenderer()
        {
            Size = new SizeF(100, 100);
            Modificator = new ResizeRectangularModificator(this);
        }

        public PointF Location { get; set; }
        public SizeF Size { get; set; }

        public IRendererModification Modificator { get; set; }
        public IActionListProvider ActionProvider { get; set; }

        public virtual void DrawTo(Graphics graphics, IRenderingCache rendering)
        {
            graphics.FillRectangle(Brushes.Black, Location.X, Location.Y, Size.Width, Size.Height);
        }

        public virtual bool HitTest(PointF point)
        {
            return new RectangleF(Location, Size).Contains(point);
        }

    }
}